Setup automatic build & test for PRs to the main branch using github flow#3
Merged
drikusroor merged 8 commits intomainfrom Jan 19, 2025
Merged
Setup automatic build & test for PRs to the main branch using github flow#3drikusroor merged 8 commits intomainfrom
drikusroor merged 8 commits intomainfrom
Conversation
…flow Set up automatic build and test for pull requests to the main branch using GitHub flow, Vitest for tests, and Bun for installing packages and running build and test. * **package.json** - Add a `test` script to run Vitest. - Add `vitest` to `devDependencies` with version `^3.0.0`. * **.github/workflows/ci.yml** - Update the workflow to trigger on pull requests to the `main` branch. - Add steps to set up Bun, install dependencies, run build, and execute tests using Vitest. - Ensure the workflow deploys on push to the `main` branch. * **vitest.config.ts** - Create a Vitest configuration file with basic settings. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/drikusroor/elastistent?shareId=XXXX-XXXX-XXXX-XXXX).
* Add `vitest` with version `^3.0.0` * Add `jsdom` with version `^26.0.0`
* Import necessary modules and render the `App` component * Write a simple test to check if the `App` component renders without crashing
* Add `vitest` to `devDependencies` with version `^3.0.0` * Add `jsdom` to `devDependencies` with version `^26.0.0` * Add `@testing-library/react` to `devDependencies` with version `^14.0.0`
* **package.json** - Add `@testing-library/jest-dom`, `@testing-library/react`, `@types/jsdom`, `jsdom`, and `vitest` to `devDependencies`. * **src/App.test.tsx** - Import `test` and `expect` from `vitest`. - Import `@testing-library/jest-dom/vitest`. - Update test to use `document.body` for checking element presence. * **vite.config.ts** - Add `test` configuration with `jsdom` environment. * **package-lock.json** - Add new file with dependencies.
…sistency * **App.test.tsx** - Change test to use `getByTestId` instead of `getByText` - Add `data-testid` attribute to the title element in `App.tsx` * **App.tsx** - Replace single quotes with double quotes for consistency - Add `data-testid` attribute to the title element - Refactor various functions to use arrow functions and consistent formatting - Update event listeners to use double quotes for event names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set up automatic build and test for pull requests to the main branch using GitHub flow, Vitest for tests, and Bun for installing packages and running build and test.
package.json
testscript to run Vitest.vitesttodevDependencieswith version^3.0.0..github/workflows/ci.yml
mainbranch.mainbranch.vitest.config.ts
For more details, open the Copilot Workspace session.